package com.etc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.etc.dao.RecruitmentMapper;
import com.etc.entity.Company;
import com.etc.entity.Job;
import com.etc.entity.LayUiData;
import com.etc.entity.RecJoin;
import com.etc.entity.Recruitment;
import com.etc.service.RecruitmentService;

@Service
public class RecruitmentServiceImpl  implements RecruitmentService{
	@Autowired
	private RecruitmentMapper recruitmentMapper;

	@Override
	public List<Recruitment> selectRec() {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectRec();
	}

	@Override
	public List<Recruitment> selectRecByCity(String strLike) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectRecByCity(strLike);
	}

	@Override
	public List<Recruitment> selectRecName(String strLikeName) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectRecName(strLikeName);
	}


	@Override
	public boolean selectRecDel(String recName) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectRecDel(recName);
	}

	@Override
	public boolean selectRecUpd(int recState, String recName) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectRecUpd(recState, recName);
	}

	@Override
	public List<Recruitment> selectRecByPage(String keywords, int start, int limit) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectRecByPage(keywords, start, limit);
	}

	@Override
	public boolean AddRec(Recruitment recruitment) {
		// TODO Auto-generated method stub
		return recruitmentMapper.AddRec(recruitment);
	}
	@Override
	public boolean updRec(Recruitment recruitment) {
		// TODO Auto-generated method stub
		return recruitmentMapper.updRec(recruitment);
	}
	@Override
	public LayUiData<Recruitment> getRecByLike(int page, int limit, String strLike) {
		// TODO Auto-generated method stub
		int start = (page - 1) * limit;
		LayUiData<Recruitment> laydata = new LayUiData<Recruitment>();
		List<Recruitment> list = recruitmentMapper.selectRecByPage(strLike, start, limit);
		laydata.setCode(0);
		laydata.setMsg("");
		laydata.setCount(recruitmentMapper.getRecruitmentCount());
		laydata.setData(list);
		System.out.println("laydata:" + laydata);
		return laydata;
	}

	@Override
	public int selectDate(String strDate) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectDate(strDate);
	}

	@Override
	public List<Integer> selectcomId(Integer recId) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectcomId(recId);
	}

	@Override
	public List<Company> selectcomName(int comId) {
		// TODO Auto-generated method stub
		return recruitmentMapper.selectcomName(comId);
	}

	
   
}
